//
//  WebViewController.swift
//  Ofo-demo
//
//  Created by 张蕾 on 2017/9/4.
//  Copyright © 2017年 Abby. All rights reserved.
//

import UIKit
import WebKit

class WebViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        
        
        //创建WKWebView
        let webView = WKWebView(frame: UIScreen.main.bounds)
        
        self.title = "热门活动"
        
        //设置访问的URL
        let url = NSURL(string: "http://m.ofo.so/active.html")
        
        //根据URL创建请求
        let request = NSURLRequest(url: url! as URL)
     
        //WKWebView加载请求
        webView.load(request as URLRequest)
        
        //将webView添加到视图
        view.addSubview(webView)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
